//package com.tgpms.generator;
//
//import org.mybatis.generator.api.MyBatisGenerator;
//import org.mybatis.generator.config.Configuration;
//import org.mybatis.generator.config.xml.ConfigurationParser;
//import org.mybatis.generator.internal.DefaultShellCallback;
//
//import java.io.InputStream;
//import java.util.ArrayList;
//import java.util.List;
//
///**
// * @author May
// * <p>
// * 单独启动 Generator
// */
//public class RunWithGenerator {
//
//    public static void main(String[] args) throws Exception{
//        RunWithGenerator app = new RunWithGenerator();
//        System.out.println(app.getClass().getResource("/").getPath());
//        app.generator();
//        System.out.println("===> " + System.getProperty("user.dir"));
//    }
//
//    public void generator() throws Exception{
//
//        List<String> warnings = new ArrayList<>();
//        boolean overwrite = true;
//        InputStream resourceAsStream = this.getClass().getClassLoader().getResourceAsStream("generatorConfig.xml");
//        ConfigurationParser cp = new ConfigurationParser(warnings);
//        Configuration config = cp.parseConfiguration(resourceAsStream);
//        DefaultShellCallback callback = new DefaultShellCallback(overwrite);
//        MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config, callback, warnings);
//        myBatisGenerator.generate(null);
//
//        for(String warning:warnings){
//            System.out.println(warning);
//        }
//    }
//}
